import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { SelfComponent } from './self.component';
import { ContributeCashComponent } from './contribute-cash/contribute-cash.component';
import { MakeContributeComponent } from './make-contribute/make-contribute.component';
import { PublishListComponent } from './publish-list/publish-list.component';
import { ShareAwardComponent } from './share-award/share-award.component';
import { AuthGuard } from 'src/app/auth/auth.guard';

// prefix / full  loadChildren: () => import('./page/publish/publish.module').then(mod => mod.PublishModule)
const routes: Routes = [
    {
        path: '',
        canActivate: [AuthGuard],
        children: [
            {path: 'self', component: SelfComponent,},
            {path: 'self-publish', component: PublishListComponent},
            {path: 'share', component: ShareAwardComponent},
            {path: 'make', component: MakeContributeComponent},
            {path: 'cash', component: ContributeCashComponent},
            {path:'', redirectTo: '/self', pathMatch: 'full'}
        ]
    }
];

@NgModule({
    imports: [RouterModule.forChild(routes)],
    exports: [RouterModule]
})
export class SelfRoutingModule { }
